package com.swe727.spring2011.constraint1.node;

import java.util.Date;

import com.swe727.spring2011.constraint1.node.*;
import com.swe727.spring2011.constraint1.message.Message;

/**
 * A NodeRegistration represents the registration of a node 
 * with the Zone Server
 * @author Fernando Boccanera
 *
 */
public class NodeRegistration implements Message<Node> {

	/**
	 * serial ID
	 */
	private static final long serialVersionUID = 2149205354250670235L;
	/**
	 * The coordinate of the node
	 */
	private final Node NODE;
	/**
	 * Date this registration was created.
	 */
	private final Date TIMESTAMP;
	/**
	 * Create new NodeRegistration. 
	 * @param node indicates the node that is registering
	 */
	public NodeRegistration(Node node) {
		NODE = node; 
		TIMESTAMP = new Date();
	}
	
	/** 
	 * Getter methods
	 */
	public Node getNode() {
		return NODE;
	}

	@Override
	public Date getTimestamp() {
		return TIMESTAMP;
	}

	@Override
	public Node getData() {
		return NODE;
	}
}